package com.nuanqian.springbootdubboserver.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.nuanqian.springbootdubboapi.service.TestService;
import com.nuanqian.springbootdubboentity.entity.User;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 具体实现
 * @author 李蒙
 * @date 2020/6/17 15:20
 */
@Service(version = "1.0.0",timeout = 10000,group = "2")
public class Test2ServiceImpl implements TestService {
    @Override
    public String sayHello(String str) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return "1.0.1"+":"+dateFormat.format(new Date()) + ": " + str;
    }

    @Override
    public User findUser() {
        User user = new User();
        user.setId(1001);
        user.setUsername("scott");
        user.setPassword("1.0.1");
        user.setAge(20);
        user.setGender(0);
        return user;
    }
}
